export const resetForm = (self,formName)=>{
    if(self.$refs[formName]){
        self.$refs[formName].resetFields();
    }
}
export const isNull = ( str )=>{
    if ( str == "" ) return true;
        var regu = "^[ ]+$";
        var re = new RegExp(regu);
        return re.test(str);
    }
export const isIP = function (strIP) {
    if (isNull(strIP)) return false;
    var re=/^(\d+).(\d+).(\d+).(\d+)$/g //匹配IP地址的正则表达式
    if(re.test(strIP))
    {
    if( RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256) return true;
    }
    return false;
}
export const decToHex = num =>{
    let sum = num.toString(16);
    while(sum.length < 8){
        sum = '0'+sum
    }
    return '0x'+sum;
}